{%extends 'base.html'%}
{% import '_macros.html' as macros %}

{%block content%}
        <div class="container">
            <div class="row">
                <div class="col-md-8">
                {%for post in posts%}
                    <article class="article the-font" style="display:">
                        <a href="/p/{{post.pid}}">
                            <h3 style="color:#34495E">
                                {{post.title|safe}}
                            </h3>
                        </a>
                        <p>
                            <small>
                                <span class="glyphicon glyphicon-calendar" aria-hidden="true">
                                </span>
                                <span style="color:#8C8C8C;">
                                    {{post.inserttime|safe}}
                                </span>
                            </small>
                        </p>
                        <div class="wrap">
                        {{post.description|safe}}
                        </div>
                                <div style="border-top:1px solid #EBEBEB;padding:10px 5px;margin-top:20px;">
                                    <p>
                                       {# <a href="/tag/大学生创业">
                                            <span class="label label-default text-left">
                                                <span class="glyphicon glyphicon-leaf" aria-hidden="true">
                                                </span>
                                                大学生创业
                                            </span>
                                            </a>
                                        #}
                                            <a href="/p/{{post.pid}}" style="float:right">
                                                <button class="btn  btn-primary btn-wide text-right">
                                                    <span class="glyphicon glyphicon-fire
                                                    glyphicon " aria-hidden="true">
                                                    </span>
                                                    了解更多
                                                </button>
                                            </a>
                                    </p>
                                </div>
                    </article>

                    {%endfor%}
                <div class="text-center">
                {% if pagination %}
                <div class="pagination">
                    {{ macros.pagination_widget(pagination, endpoint) }}
                </div>
                {% endif %}
                </div>

                </div>
                <div class="col-md-4 collapse navbar-collapse">
                    <div class="share mrl the-font" style="background-color:#FFF;box-shadow:5px 5px 20px #CCC;width:260px;">
                        <div style="padding:10px;">
                            <div style="border-bottom:1px solid #DAD4D4;;padding:10px 10px;">
                                <h6>
                                    <span class="glyphicon glyphicon-leaf" aria-hidden="true">
                                    </span>
                                    热门文章
                                </h6>
                            </div>
                            <ul>
                            {%for _post in Post.query.order_by(Post.viewtimes.desc()).limit(20).all()%}
                                <li class="presentation" style="padding-top:0px;">
                                    <a href="/p/{{_post.pid}}">
                                        <p>
                                            <span style="font-size:15px;">
                                                {{_post.title|safe}}
                                            </span>
                                            <span class="badge text-right" style="float:right">
                                                {{_post.viewtimes}}
                                            </span>
                                        </p>
                                    </a>
                                </li>
                            {%endfor%}
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
{%endblock content%}
